package com.tm.mholmu.db;

import com.tm.mholmu.application.Util;

/**
 * 单件装备对象
 *   
 * @author CTX
 * 
 */
public class Outfit {
	/** 名称 */
	public String name = "null";
	/** 远近-- 0为近 1为远 */
	public String distance = "远";
	/**部位 */
	public String part = "头";
	/**孔*/
	public int hole = 0;
	/**拥有技能*/
	public String skill = "";
	/**依次N_*是相对应的技能*/
	public int N_1=0;
	public int N_2=0;
	public int N_3=0;
	public int N_4=0;
	public int N_5=0;
	public int N_6=0;
/**依次Z_*是相对应的技能值*/
	public int Z_1=0;
	public int Z_2=0;
	public int Z_3=0;
	public int Z_4=0;
	public int Z_5=0;
	public int Z_6=0;
	/**装备id*/
	public int id = 0;


	public Outfit(String name, String distance, String part, int hole, String skill, int id) {
		this.name = name;
		this.distance = distance;
		this.part = part;
		this.hole = hole;
		this.skill = skill;
		this.id = id;
	}
	public Outfit(String name, String distance, String part, int hole, String skill) {
		this.name = name;
		this.distance = distance;
		this.part = part;
		this.hole = hole;
		this.skill = skill;
		
	}
	public Outfit() {
	}

	public int get(int i) {
		int[] int_skill = Util.StringToInt(skill);
		for (int j = 0; j < int_skill.length; j++) {
		if (i==int_skill[j]) {
			return getint(j);
		}
		}
		return 0;
	}
	
	public int getint(int i) {
		switch (i) {
		case 0:
			return Z_1;
		case 1:
			return Z_2;
		case 2:
			return Z_3;
		case 3:
			return Z_4;
		case 4:
			return Z_5;
		case 5:
			return Z_6;
		default:
			return 0;
		}
	}
	
}
